<template>
	<view class="article">
		<navigator :url="'/pages/detail/detail?p='+ item.article_id" v-for="item in articleList" :key="item.article_id">
			<view class="article-item">
				<view class="article-simp">
					<view class="article-title">{{ item.article.article_title }}</view>
					<view class="article-other">
						<view class="article_time">{{ item.article.add_time | dateFormat }}</view>
					</view>
				</view>
				<image :src="item.article.cover_image" class="cover_img"></image>
			</view>
		</navigator>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				articleList: []
			}
		},
		onLoad() {
			this.getLikeArticleList()
		},
		methods: {
			getLikeArticleList: function() {
				uni.request({
					url: 'https://blog.lgdweb.com/api/like/likeArticleList/user_id/'+ uni.getStorageSync('user_id'),
					success: res => {
						this.articleList = res.data.data.like_list;
					},
					fail: err => {
						console.log(err)
					}
				})
			},
		}
	}
</script>

<style>
	@import url("/static/css/list.css");
	.article {
		margin-top: 0;
	}
</style>
